# 1. 高德开放平台 - 地理/逆地理编码API
import requests
geo_url = "https://restapi.amap.com/v3/geocode/geo?parameters"
payload = {
    "key":"1be5ca0aa358c1ee57ba35fbaf2416bb",
    "address":"广东省广州市文化馆"
}
r = requests.get(url=geo_url, params=payload)
广东省广州市文化馆_location = r.json()['geocodes'][0]['location']
广东省广州市文化馆_location

around_url = 'https://restapi.amap.com/v3/place/around?parameters'

payload = {
    "key":"1be5ca0aa358c1ee57ba35fbaf2416bb",
    "location":广东省广州市文化馆_location,
    "keywords":"博物馆"
}
r = requests.get(around_url,params=payload)

r.json()

Output exceeds the size limit. Open the full output data in a text editor
{'status': '1',
 'info': 'OK',
 'infocode': '10000',
 'count': '74',
 'suggestion': {'keywords': [], 'cities': []},
 'pois': [{'id': 'B0FFGLLSJW',
   'parent': [],
   'childtype': [],
   'name': '祝福博物馆(珠影·星光城店)',
   'type': '科教文化服务;博物馆;博物馆',
   'typecode': '140100',
   'biz_type': [],
   'address': '新港中路354号珠影星光城创墟Y06',
   'location': '113.321956,23.094483',
   'tel': [],
   'pname': '广东省',
   'cityname': '广州市',
   'adname': '海珠区',
   'importance': [],
   'shopid': [],
   'shopinfo': '0',
   'poiweight': [],
   'distance': '442',
   'biz_ext': {'rating': '3.4', 'cost': []},
   'photos': []},
...
   'shopinfo': '0',
   'poiweight': [],
   'distance': '4654',
   'biz_ext': {'rating': '3.1', 'cost': []},
   'photos': []}]}

---

# 2. 高德开放平台 - 静态地图API

geo_url = "https://restapi.amap.com/v3/staticmap?parameters"
payload = {
    "key":"1be5ca0aa358c1ee57ba35fbaf2416bb",
    "location": 广东省广州市文化馆_location,
    'zoom': 15,
}


r_staticmap = requests.get(url=geo_url, params=payload)
r_staticmap.url

'https://restapi.amap.com/v3/staticmap?parameters&key=1be5ca0aa358c1ee57ba35fbaf2416bb&location=113.323551%2C23.098179&zoom=15'

![这是图片](https://restapi.amap.com/v3/staticmap?parameters&key=1be5ca0aa358c1ee57ba35fbaf2416bb&location=113.323551%2C23.098179&zoom=15)

---

# 3. 高德开放平台 - 路径规划API
import requests
geo_url = "https://restapi.amap.com/v3/geocode/geo?parameters"
payload = {
    "key":"1be5ca0aa358c1ee57ba35fbaf2416bb",
    "address":"广东省广州市大剧院"
}
r = requests.get(url=geo_url, params=payload)
广东省广州市大剧院_location = r.json()['geocodes'][0]['location']
广东省广州市大剧院_location


'113.322577,23.115025'



geo_url = "https://restapi.amap.com/v3/direction/walking?parameters"
payload = {
    "key":"1be5ca0aa358c1ee57ba35fbaf2416bb",
    "origin": 广东省广州市文化馆_location,
    'destination': 广东省广州市大剧院_location,
}


r_walking = requests.get(url=geo_url, params=payload)
r_walking.json()


Output exceeds the size limit. Open the full output data in a text editor
{'status': '1',
 'info': 'ok',
 'infocode': '10000',
 'count': '1',
 'route': {'origin': '113.323551,23.098179',
  'destination': '113.322577,23.115025',
  'paths': [{'distance': '3340',
    'duration': '2672',
    'steps': [{'instruction': '沿艺苑路向北步行228米向右前方行走',
      'orientation': '北',
      'road': '艺苑路',
      'distance': '228',
      'duration': '182',
      'polyline': '113.323628,23.098281;113.323628,23.09842;113.323628,23.09842;113.32362,23.099236;113.32362,23.099236;113.323602,23.1;113.323637,23.100095;113.323681,23.100148;113.323837,23.100269',
      'action': '向右前方行走',
      'assistant_action': [],
      'walk_type': '0'},
     {'instruction': '沿艺苑路向东北步行101米向左前方行走',
      'orientation': '东北',
      'road': '艺苑路',
      'distance': '101',
      'duration': '81',
      'polyline': 
      '113.323837,23.100269;113.324423,23.100677;113.324423,23.100677;113.324444,23.100694;113.324444,23.100694;113.324596,23.100833;113.324614,23.100855',
      'action': '向左前方行走',
      'assistant_action': [],
...
      'duration': '43',
      'polyline': '113.322391,23.114557;113.322422,23.114605;113.322483,23.114809;113.322569,23.114996;113.322569,23.114996;113.322587,23.115013',
      'action': [],
      'assistant_action': '到达目的地',
      'walk_type': '0'}]}]}}